package com.java.base.jvm;

import java.time.LocalTime;

public class GCDetails {


    public static void main(String[] args) throws InterruptedException {

        heaps();
    }


    public static void wh() {
        GCDetails gcDetails = new GCDetails();
        while (gcDetails != null) {
            gcDetails = new GCDetails();
            System.out.println(LocalTime.now().toString() + gcDetails);
        }

    }

    public static void heaps() throws InterruptedException {
        for (int i = 0; i < 1000; i++) {
            heap();
            Thread.sleep(10000);
        }

    }

    public static GCDetails[] heap() {
        GCDetails[] bytes = null;
        for (int i = 0; i < 100; i++) {
            bytes = new GCDetails[2 * 1024 * 1024];
        }
        return bytes;
    }

    public static void noObj() {
        while (true) {
            byte[] bytes = new byte[8 * 1024];
        }
    }

}
